home *** CD-ROM | disk | FTP | other *** search
/ Power CD / Power CD ATARI-Rechner Lieben.iso / ALLERLEI / GOBJ_112 / SOURCE / HELLO.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-03-03  |  1015 b   |  48 lines

  1. program Hello;
  2.     { this is a complete GEM application, which opens a
  3.       window to print the 'Hello world' message; things
  4.       like iconifications are supported automatically   }
  5.  
  6. uses
  7.  
  8.     Gem,OTypes,OWindows;
  9.  
  10. type
  11.  
  12.     TMyApplication = object(TApplication)
  13.         procedure InitMainWindow; virtual;
  14.     end;
  15.  
  16.     PMyWindow = ^TMyWindow;
  17.     TMyWindow = object(TWindow)
  18.         procedure Paint(var PaintInfo: TPaintStruct); virtual;
  19.     end;
  20.  
  21. var
  22.  
  23.     MyApplication: TMyApplication;
  24.  
  25.  
  26. procedure TMyApplication.InitMainWindow;
  27.  
  28.     begin
  29.         new(PMyWindow,Init(nil,''));
  30.         if (MainWindow=nil) or (ChkError<em_OK) then
  31.             Status:=em_InvalidMainWindow
  32.     end;
  33.  
  34.  
  35. procedure TMyWindow.Paint(var PaintInfo: TPaintStruct);
  36.  
  37.     begin
  38.         v_gtext(vdiHandle,Work.X+GP.charWidth,Work.Y+GP.boxHeight,
  39.                                        'Hello, ObjectGEM-world...')
  40.         { this method uses the rectangle list _automatically_ }
  41.     end;
  42.  
  43.  
  44. begin
  45.   MyApplication.Init('HWRL','Hello world');
  46.   MyApplication.Run;
  47.   MyApplication.Done
  48. end.